{extend name="public/help" /}
{block name="oneMenuName"}{$crumbs['oneMenuName']}{/block}
{block name="twoMenuName"}{$crumbs['twoMenuName']}{/block}
{block name="body"}
<div class="main-content">
    <div class="row">
        <div class="col-lg-6">
            <div class="card alert">
                <div class="card-header">
                    <h4>搜索</h4>
                </div>
                <div class="card-body">
                    <div class="basic-form">
                        <form>
                            <div class="form-group">
                                <!--                                <p class="text-muted m-b-15 f-s-12">Use the input classes on an <code>input-default</code> for Default input.</p>-->
                                <div class="input-group input-group-default">
                                    <span class="input-group-btn">
                                        <button class="btn btn-primary" type="submit">
                                            <i class="ti-search"></i>
                                        </button>
                                    </span>
                                    <input type="text" placeholder="Search Default" value="{$Request.get.search}" name="search" class="form-control">
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="card alert">
                    <div class="card-header">
                        <h4>订单列表</h4>
                    </div>
                    <div class="card-body">
                        <table class="table table-responsive table-bordered">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>商家名称</th>
                                <th>订单编号</th>
                                <th>用户名</th>
                                <th>收货地址</th>
                                <th>支付金额</th>
                                <th>支付方式</th>
                                <th>订单状态</th>
                                <th>支付时间</th>
                                <th>快递公司</th>
                                <th>快递单号</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {foreach $data as $k => $v}
                            <tr>
                                <td scope="row">{$v.id}</td>
                                <td scope="row">{$v.b_name}</td>
                                <td scope="row">{$v.order_code}</td>
                                <td scope="row">{$v.user_name}</td>
                                <td scope="row">{$v.addr}</td>
                                <td scope="row">{$v.price}</td>
                                <td scope="row">
                                    {if $v.status != 1}
                                        {if $v.pay_type == 1}
                                            微信
                                        {else}
                                            支付宝
                                        {/if}
                                    {/if}
                                </td>
                                <td scope="row">
                                    {switch name="$v.status"}
                                        {case value="1"}未支付{/case}
                                        {case value="2"}未发货{/case}
                                        {case value="3"}未签收{/case}
                                        {case value="4"}已签收{/case}
                                        {case value="5"}退货/退款{/case}
                                        {case value="6"}订单失效{/case}
                                    {/switch}
                                </td>
                                <td scope="row">
                                    {if $v.pay_time != 0}
                                        {$v.pay_time|date="Y-m-d H:i:s",###}
                                    {/if}
                                </td>
                                <td scope="row">{$v.express_name}</td>
                                <td scope="row">{$v.express_code}</td>
                                <td >
                                    <!--<a href="">-->
                                    <!--    <button type="button" class="btn btn-info m-b-10 m-l-3">详情</button>-->
                                    <!--</a>-->
                                    <button type="button" class="btn btn-info m-b-10 m-l-3 goods_details" b_id="{$v.b_id}" order_code="{$v.order_code}">详情</button>
                                    <!--<a href="{:url('/admin/editSaasOrder', ['id' => $v.id])}"><button type="button" class="btn btn-warning m-b-10 m-l-5">修改</button></a>-->
                                </td>
                            </tr>
                            {/foreach}
                            </tbody>
                        </table>
                        {$data->render()}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

{/block}
{block name="js"}
<script>
    $('.goods_details').click(function () {
        var order_code = $(this).attr('order_code');
        var b_id = $(this).attr('b_id');
        layer.open({
            type: 2,
            area: ['700px', '700px'],
            btn: ['关闭'],
            title: '订单详情',
            content: '/admin/detailsSaasOrder/order_code/'+order_code+'/b_id/'+b_id,
        });
    })
</script>
{/block}

